from numba import jit


import numpy as np


@jit(nopython=True)  # 使用 nopython 模式以获得最佳性能
def sum_array(arr):
    total = 0
    for i in range(arr.shape[0]):
        total += arr[i]
    return total


arr = np.arange(1000000)
result = sum_array(arr)
print(result)



